Skip to content

Wait for the driver before starting GPU operands - #2881

Merged
rajathagasthya merged 1 commit into
NVIDIA:mainfrom
sylvesterkaczmarek:fix-operand-driver-readiness-gate
Sep 14, 2026
Merged

rajathagasthya merged 1 commit into
NVIDIA:mainfrom
sylvesterkaczmarek:fix-operand-driver-readiness-gate

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Fixes #2874

Description

Require the live NVIDIA kernel module as well as toolkit-ready before creating GPU Operator operand containers that use the NVIDIA runtime. This prevents a stale validation file from admitting an operand while the driver is temporarily unloaded, when the runtime would create the container without driver libraries.

The guard is applied consistently to GPU Feature Discovery, Device Plugin, DCGM, DCGM Exporter, MIG Manager, and MPS Control Daemon.

Checklist

  • No secrets, sensitive information, or unrelated changes
  • Lint checks passing (make lint)
  • Generated assets in-sync (make validate-generated-assets)
  • Go mod artifacts in-sync (make validate-modules)
  • Test cases are added for new code paths

Testing

  • make unit-test - passed
  • go test ./controllers -run TestOperandToolkitReadinessWaitsForDriverModule -count=1 - passed
  • make fmt - passed
  • make validate-modules - passed
  • make lint reports three existing SA4023 findings in cmd/nvidia-validator/main.go; the same three findings reproduce on pristine main

@copy-pr-bot

copy-pr-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

The operand toolkit-validation init containers now wait for both /run/nvidia/validations/toolkit-ready and the loaded nvidia kernel module. The change applies to GPU Feature Discovery, DCGM, the device plugin, MIG manager, MPS control, and DCGM exporter. A table-driven test verifies these conditions across all six manifests.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to 41de0

The production readiness gate is implemented, but its regression test can accept a bypassed gate, leaving future changes able to reintroduce startup during driver unavailability without test coverage.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
controllers/object_controls_test.go-1294-1295 (1)

1294-1295: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert that the readiness predicates are conjunctive.

If the manifest changes && to ||, both assertions still pass. In that state, a stale toolkit-ready file can admit an operand while the driver module is unloaded. Assert the combined predicate.

Proposed fix
-			require.Contains(t, args, "/run/nvidia/validations/toolkit-ready")
-			require.Contains(t, args, "grep -q '^nvidia ' /proc/modules",
+			require.Contains(t, args,
+				"[ -f /run/nvidia/validations/toolkit-ready ] && grep -q '^nvidia ' /proc/modules",
 				"stale toolkit-ready must not admit an operand while the NVIDIA driver is unloaded")

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: ddd8f033-2412-43db-a81b-450bbb244c99

📥 Commits

Reviewing files that changed from the base of the PR and between 9f85a2a and 16d3092.

📒 Files selected for processing (7)
  • assets/gpu-feature-discovery/0500_daemonset.yaml
  • assets/state-dcgm-exporter/0800_daemonset.yaml
  • assets/state-dcgm/0400_dcgm.yml
  • assets/state-device-plugin/0500_daemonset.yaml
  • assets/state-mig-manager/0600_daemonset.yaml
  • assets/state-mps-control-daemon/0400_daemonset.yaml
  • controllers/object_controls_test.go

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix-operand-driver-readiness-gate branch from bcea658 to 037af50 Compare September 10, 2026 16:38
@rajathagasthya

Copy link
Copy Markdown
Contributor

/ok-to-test 037af50

@rajathagasthya

Copy link
Copy Markdown
Contributor

@sylvesterkaczmarek Thanks for the contribution! Can you please squash your commits and make sure it's signed?

@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix-operand-driver-readiness-gate branch from 037af50 to 41de0bd Compare September 10, 2026 21:17
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Done. Squashed to one commit and re-signed it; the new head is 41de0bd.

@rajathagasthya

Copy link
Copy Markdown
Contributor

/ok-to-test 41de0bd

@rajathagasthya

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
controllers/object_controls_test.go-1294-1294 (1)

1294-1294: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the assertion reject bypassed readiness gates.

This substring check passes for until true || [ -f /run/nvidia/validations/toolkit-ready ] && grep -q '^nvidia ' /proc/modules; do ...; done. That command exits the loop before either readiness condition is checked. Assert that the command starts with the required until [ -f ... ] && grep ... condition and reject || bypasses.

This prevents a regression that starts an NVIDIA-runtime operand while the driver is unloaded. As per path instructions, flag assertions that pass when the behavior under test is broken.

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: 450587da-3df3-4d82-95a4-45d352e365d2

📥 Commits

Reviewing files that changed from the base of the PR and between 16d3092 and 41de0bd.

📒 Files selected for processing (1)
  • controllers/object_controls_test.go

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 2 potential issues.

Devin Review

Comment thread assets/gpu-feature-discovery/0500_daemonset.yaml Outdated
Comment thread controllers/object_controls_test.go Outdated
Comment on lines +1293 to +1295
require.NotEmpty(t, args, "toolkit-validation init container not found")
require.Contains(t, args, "[ -f /run/nvidia/validations/toolkit-ready ] && grep -q '^nvidia ' /proc/modules",
"toolkit readiness and driver readiness must both be required before starting an operand")

@devin-ai-integration devin-ai-integration Bot Sep 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Readiness behavior remains untested

The test only matches the added shell fragment. It never executes the gate, so unsupported driver checks and incorrect shell behavior can pass.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix-operand-driver-readiness-gate branch from 41de0bd to a721f48 Compare September 11, 2026 16:13
Comment thread assets/gpu-feature-discovery/0500_daemonset.yaml Outdated
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Updated the existing squashed commit for the WSL2 case found in review. Standard Linux still requires the live nvidia module, while WSL2 is accepted via the Microsoft kernel path once toolkit-ready exists. The new signed/verified head is a721f488; the targeted controller test and shell syntax check pass.

devin-ai-integration[bot]

This comment was marked as resolved.

@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix-operand-driver-readiness-gate branch from a721f48 to 891d8e3 Compare September 12, 2026 13:56
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

@rajathagasthya The /dev/dxg review change is now on signed/verified head 891d8e30. The targeted controller test and shell syntax check pass locally. NVIDIA runner checks need re-authorization for the new head when convenient.

Comment thread controllers/object_controls_test.go
Comment thread assets/state-mig-manager/0600_daemonset.yaml Outdated
@rajathagasthya

Copy link
Copy Markdown
Contributor

/cherry-pick release-26.7

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Signed-off-by: Rajath Agasthya <ragasthya@nvidia.com>
@rajathagasthya
rajathagasthya force-pushed the fix-operand-driver-readiness-gate branch from 891d8e3 to f8a024d Compare September 14, 2026 18:44
@rajathagasthya

Copy link
Copy Markdown
Contributor

/ok-to-test f8a024d

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Devin Review

Comment thread assets/gpu-feature-discovery/0500_daemonset.yaml
@rajathagasthya rajathagasthya self-assigned this Sep 14, 2026
@rajathagasthya
rajathagasthya merged commit b466db8 into NVIDIA:main Sep 14, 2026
21 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport PR created for release-26.7: #2896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operands can start without driver libraries after a driver restart and fail (MIG manager errors out with ERROR_LIBRARY_NOT_FOUND)

4 participants